﻿#include "chatform.h"
#include "ui_chatform.h"

ChatForm::ChatForm(QTcpSocket *s, QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::ChatForm)
{
    ui->setupUi(this);
    socket = s;
}

ChatForm::~ChatForm()
{
    delete ui;
}

void ChatForm::on_clearPushButton_clicked()
{
    ui->clearLineEdit->clear();
}


void ChatForm::on_sendPushButton_clicked()
{

    QByteArray ba;
    ba.append(ui->clearLineEdit->text().toUtf8());
    socket->write(ba);
}

